import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class NewThreadPool {
    public static void main(String[] args) {
        //提供指定线程数量的线程池
        ExecutorService exception = Executors.newFixedThreadPool(10);
        //执行指定的线程操作
        exception.execute(new NumberThreads());
//        exception.submit();
        //关闭连接池
        exception.shutdown();
    }
}
class NumberThreads implements Runnable{
    @Override
    public void run() {
        for (int i = 1; i <=100 ; i++) {
            if (i % 2 == 0){
                System.out.println(Thread.currentThread().getName()+":"+i);
            }
        }
    }
}
